package com.richfun.boot.controller;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.richfun.boot.common.dao.CommonDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("test")
public class TestController extends BaseController {

    @Autowired
    CommonDao<Map<String,Object>> commonDao;

    @RequestMapping("list")
    public Object testList() {
        PageHelper.startPage(1, 10);
        List<Map<String, Object>> list = commonDao.list("UserMapper.listUser", null);
        return getPageMap(new PageInfo<>(list));
    }


}
